<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Doxygen: common/include/pcl/common/geometry.h 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Doxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('common_2include_2pcl_2common_2geometry_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">函数</a>  </div>
  <div class="headertitle">
<div class="title">geometry.h 文件参考<div class="ingroups"><a class="el" href="group__common.html">Common components</a> &#124; <a class="el" href="group__common.html">Common components</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;Eigen/Core&gt;</code><br />
</div>
<p><a href="common_2include_2pcl_2common_2geometry_8h_source.html">浏览源代码.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:a2fc89f0c26b7c7377fcd2851fa933b87"><td class="memTemplParams" colspan="2">template&lt;typename PointT &gt; </td></tr>
<tr class="memitem:a2fc89f0c26b7c7377fcd2851fa933b87"><td class="memTemplItemLeft" align="right" valign="top">float&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="common_2include_2pcl_2common_2geometry_8h.html#a2fc89f0c26b7c7377fcd2851fa933b87">pcl::geometry::distance</a> (const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;p1, const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;p2)</td></tr>
<tr class="separator:a2fc89f0c26b7c7377fcd2851fa933b87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e7908dcc6781884b15b93938f70e6aa"><td class="memTemplParams" colspan="2">template&lt;typename PointT &gt; </td></tr>
<tr class="memitem:a6e7908dcc6781884b15b93938f70e6aa"><td class="memTemplItemLeft" align="right" valign="top">float&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="common_2include_2pcl_2common_2geometry_8h.html#a6e7908dcc6781884b15b93938f70e6aa">pcl::geometry::squaredDistance</a> (const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;p1, const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;p2)</td></tr>
<tr class="separator:a6e7908dcc6781884b15b93938f70e6aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae60b45012f015b2c9ad75f8c091dcd92"><td class="memTemplParams" colspan="2">template&lt;typename PointT , typename NormalT &gt; </td></tr>
<tr class="memitem:ae60b45012f015b2c9ad75f8c091dcd92"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="common_2include_2pcl_2common_2geometry_8h.html#ae60b45012f015b2c9ad75f8c091dcd92">pcl::geometry::project</a> (const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;point, const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;plane_origin, const <a class="el" href="structpcl_1_1_normal.html">NormalT</a> &amp;plane_normal, <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;projected)</td></tr>
<tr class="separator:ae60b45012f015b2c9ad75f8c091dcd92"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4bf84d4aa0c90070281d5895f962e21"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_2include_2pcl_2common_2geometry_8h.html#ac4bf84d4aa0c90070281d5895f962e21">pcl::geometry::project</a> (const Eigen::Vector3f &amp;point, const Eigen::Vector3f &amp;plane_origin, const Eigen::Vector3f &amp;plane_normal, Eigen::Vector3f &amp;projected)</td></tr>
<tr class="separator:ac4bf84d4aa0c90070281d5895f962e21"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>Defines some geometrical functions and utility functions </p>
</div><h2 class="groupheader">函数说明</h2>
<a id="a2fc89f0c26b7c7377fcd2851fa933b87"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2fc89f0c26b7c7377fcd2851fa933b87">&#9670;&nbsp;</a></span>distance()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">float pcl::geometry::distance </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;&#160;</td>
          <td class="paramname"><em>p1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;&#160;</td>
          <td class="paramname"><em>p2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>返回</dt><dd>the euclidean distance between 2 points </dd></dl>
<div class="fragment"><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    {</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;      Eigen::Vector3f diff = p1.getVector3fMap () - p2.getVector3fMap ();</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;      <span class="keywordflow">return</span> (diff.norm ());</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    }</div>
</div><!-- fragment -->
</div>
</div>
<a id="ac4bf84d4aa0c90070281d5895f962e21"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac4bf84d4aa0c90070281d5895f962e21">&#9670;&nbsp;</a></span>project() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void pcl::geometry::project </td>
          <td>(</td>
          <td class="paramtype">const Eigen::Vector3f &amp;&#160;</td>
          <td class="paramname"><em>point</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Eigen::Vector3f &amp;&#160;</td>
          <td class="paramname"><em>plane_origin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Eigen::Vector3f &amp;&#160;</td>
          <td class="paramname"><em>plane_normal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Eigen::Vector3f &amp;&#160;</td>
          <td class="paramname"><em>projected</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>返回</dt><dd>the point projection on a plane defined by its origin and normal vector </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">point</td><td>Point to be projected </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">plane_origin</td><td>The plane origin </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">plane_normal</td><td>The plane normal </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">projected</td><td>The returned projected point </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    {</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;      Eigen::Vector3f po = point - plane_origin;</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;      <span class="keywordtype">float</span> lambda = plane_normal.dot(po);</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;      projected = point - (lambda * plane_normal);</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    }</div>
</div><!-- fragment -->
</div>
</div>
<a id="ae60b45012f015b2c9ad75f8c091dcd92"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae60b45012f015b2c9ad75f8c091dcd92">&#9670;&nbsp;</a></span>project() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT , typename NormalT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void pcl::geometry::project </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;&#160;</td>
          <td class="paramname"><em>point</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;&#160;</td>
          <td class="paramname"><em>plane_origin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structpcl_1_1_normal.html">NormalT</a> &amp;&#160;</td>
          <td class="paramname"><em>plane_normal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;&#160;</td>
          <td class="paramname"><em>projected</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>返回</dt><dd>the point projection on a plane defined by its origin and normal vector </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">point</td><td>Point to be projected </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">plane_origin</td><td>The plane origin </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">plane_normal</td><td>The plane normal </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">projected</td><td>The returned projected point </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    {</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;      Eigen::Vector3f po = point - plane_origin;</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;      <span class="keyword">const</span> Eigen::Vector3f normal = plane_normal.getVector3fMapConst ();</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;      <span class="keywordtype">float</span> lambda = normal.dot(po);</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;      projected.getVector3fMap () = point.getVector3fMapConst () - (lambda * normal);</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a6e7908dcc6781884b15b93938f70e6aa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6e7908dcc6781884b15b93938f70e6aa">&#9670;&nbsp;</a></span>squaredDistance()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">float pcl::geometry::squaredDistance </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;&#160;</td>
          <td class="paramname"><em>p1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;&#160;</td>
          <td class="paramname"><em>p2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>返回</dt><dd>the squared euclidean distance between 2 points </dd></dl>
<div class="fragment"><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    {</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;      Eigen::Vector3f diff = p1.getVector3fMap () - p2.getVector3fMap ();</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;      <span class="keywordflow">return</span> (diff.squaredNorm ());</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    }</div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_bdd9a5d540de89e9fe90efdfc6973a4f.html">common</a></li><li class="navelem"><a class="el" href="dir_11fbc4217d50ab21044e5ad6614aede5.html">include</a></li><li class="navelem"><a class="el" href="dir_39ef148c3cf3468c290ae8c03b3c03af.html">pcl</a></li><li class="navelem"><a class="el" href="dir_474708a720ff06817ce2c12e28baf137.html">common</a></li><li class="navelem"><a class="el" href="common_2include_2pcl_2common_2geometry_8h.html">geometry.h</a></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
